from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String ,DateTime, Boolean, SmallInteger
import datetime

# 获取基类
Base = declarative_base()

# 继承基类
class Company(Base):
    __tablename__ = 'company'

    id = Column(Integer, primary_key = True)

    city_code = Column(Integer, comment = '城市编码')

    cat_id = Column(Integer, comment = '上级id')

    company = Column(String(255))

    is_company = Column(SmallInteger)

    contact_person = Column(String(50))

    member = Column(Integer)

    phone = Column(String(50))

    created_time = Column(DateTime,  default = datetime.datetime.now, comment='创建时间')

    updated_time = Column(DateTime,  default = datetime.datetime.now, comment='更新时间')